home *** CD-ROM | disk | FTP | other *** search
/ Winzipper / Winzipper_ISO.iso / nt4.0 server / DRVLIB.NIC / XIRCOM / CM2 / OEMSETUP.INF < prev    next >
Encoding:
INI File  |  1996-07-31  |  44.8 KB  |  1,533 lines

  1. ;***********************************************************************
  2. ;
  3. ; OEMSETUP.INF
  4. ;
  5. ;       Xircom CEM-2 CreditCard Adapter Setup for NT 4.0
  6. ;
  7. ;*******************************************************************************
  8.                                      
  9. ;shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) STATUS "message"
  10.  
  11. [Identification]
  12.     OptionType = NetAdapter
  13.  
  14. [PlatformsSupported]
  15.     ISA
  16.     EISA
  17.     MCA
  18.  
  19. [Options]
  20.     CM2NDIS3
  21.  
  22. [OptionsTextENG]
  23.     CM2NDIS3    = "Xircom CreditCard Ethernet+Modem II"
  24.  
  25.  
  26. [AllFileConstants]
  27. GenericInfVersion  = " v1.18"
  28. ;  File names, etc. ----------------------------------------
  29. UtilityInf      = "UTILITY.INF"
  30. ParamInf        = "NCPARAM.INF"
  31. subroutineinf   = "SUBROUTN.INF"
  32. SoftwareType    = "driver"
  33. Exit_Code       = 0
  34. ; EventLog Message File  ----------------------------------------
  35. NetEventDLL     = "%SystemRoot%\System32\netevent.dll"
  36. IoLogMsgDLL     = "%SystemRoot%\System32\IoLogMsg.dll"
  37. ; Product Info ----------------------------------------
  38. Manufacturer    = "Xircom"
  39.  
  40.  
  41.  
  42.  
  43.  
  44. [FileConstants-CM2NDIS3]
  45. GenericAdapterName = "Xircom CreditCard Ethernet+Modem II"
  46. GenericDriverName  = "Xircom CreditCard Ethernet+Modem II Driver"
  47. GenericSysName     = "CM2NDIS3.sys"
  48. GenericName        = "CM2NDIS3"
  49. ; Product Info ----------------------------------------
  50. ProductMajorVersion     = "1"
  51. ProductMinorVersion     = "08"
  52. ProductVersion  = $(ProductMajorVersion)"."$(ProductMinorVersion)
  53. ; Software  ----------------------------------------
  54. ProductSoftwareName     = "CM2NDIS3"
  55. ProductSoftwareDescription = "Xircom CreditCard Ethernet+Modem II Driver"
  56. ProductSoftwareImagePath = "\SystemRoot\System32\drivers\"$(GenericSysName)
  57. NetRuleSoftwareType     = "cm2ndis3Sys ndisDriver cm2ndis3Driver"
  58. NetRuleSoftwareUse      = $(SoftwareType)
  59. NetRuleSoftwareBindForm = """cm2ndis3Sys"" yes no container"
  60. NetRuleSoftwareClass    = {"cm2ndis3Driver basic"}
  61. NetRuleSoftwareBindable = {"cm2ndis3Driver cm2ndis3Adapter non exclusive 100"}
  62. ; Hardware  ----------------------------------------
  63. ProductHardwareName        = "CM2NDIS3"
  64. ProductHardwareDescription = "Xircom CreditCard Ethernet+Modem II"
  65. NetRuleHardwareType        = "cm2ndis3 cm2ndis3Adapter"
  66. NetRuleHardwareBindForm    = " yes yes container"
  67. NetRuleHardwareClass       = {"cm2ndis3Adapter basic"}
  68. ; Registry Key  ----------------------------------------
  69. ProductKeyName  = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(ProductSoftwareName)"\CurrentVersion"
  70. ParamKeyName    = $(!NTN_ServiceBase)"\"$(ProductHardwareName)"\Parameters"
  71. ; Tuple Information -----------------------------------
  72. VERS1Manufacturer = "Xircom"
  73. VERS1Product      = "CreditCard Ethernet+Modem II"
  74. VERS1Type                 = "CEM2"
  75.  
  76.  
  77.  
  78.  
  79. [GeneralConstants]
  80. ;  Program flow control variables.
  81. from      = ""
  82. to        = ""
  83. ;  Return codes; Exit_Code is set to one of these
  84. ExitCodeOk     = 0
  85. ExitCodeCancel = 1
  86. ExitCodeFatal  = 2
  87. KeyNull         = ""
  88. MAXIMUM_ALLOWED   = 33554432
  89. RegistryErrorIndex = NO_ERROR
  90. KeyProduct      = ""
  91. KeyParameters   = ""
  92. TRUE            = 1
  93. FALSE           = 0
  94. NoTitle            = 0
  95. ExitState   = "Active"
  96. OldVersionExisted = $(FALSE)
  97. DriverPath      = $(!STF_NTPATH)\drivers
  98.  
  99.  
  100.  
  101.  
  102. [date]
  103.     ; Now is a list which contains { Sec from 1-1-1970, Year, Month, Day, Hour,
  104.     ; Minute, Second }
  105.     Now = {} ? $(!LIBHANDLE) GetSystemDate
  106.  
  107.  
  108. ;---------------------------------------------------------------------------
  109. ; 1. Identify
  110. ;
  111. ; DESCRIPTION:   To verify that this INF deals with the same type of options
  112. ;                as we are choosing currently.
  113. ;
  114. ; INPUT:         None
  115. ;
  116. ; OUTPUT:        $($R0): STATUS: STATUS_SUCCESSFUL
  117. ;                $($R1): Option Type (COMPUTER ...)
  118. ;                $($R2): Diskette description
  119. ;---------------------------------------------------------------------------
  120.  
  121. [Identify]
  122.     ;
  123.     ;
  124.     read-syms Identification
  125.     
  126.     set Status     = STATUS_SUCCESSFUL
  127.     set Identifier = $(OptionType)
  128.     set Media      = #("Source Media Descriptions", 1, 1)
  129.  
  130.     Return $(Status) $(Identifier) $(Media)
  131.  
  132. ;------------------------------------------------------------------------
  133. ; 2. ReturnOptions:
  134. ;
  135. ; DESCRIPTION:   To return the option list supported by this INF and the
  136. ;                localised text list representing the options.
  137. ;
  138. ;
  139. ; INPUT:         $($0):  Language used. ( ENG | FRN | ... )
  140. ;
  141. ; OUTPUT:        $($R0): STATUS: STATUS_SUCCESSFUL |
  142. ;                                STATUS_NOLANGUAGE
  143. ;                                STATUS_FAILED
  144. ;                                STATUS_NOTSUPPORTED
  145. ;
  146. ;                $($R1): Option List
  147. ;                $($R2): Option Text List
  148. ;------------------------------------------------------------------------
  149.  
  150. [ReturnOptions]
  151.     ;
  152.     ;
  153.     set Status        = STATUS_FAILED
  154.     set OptionList     = {}
  155.     set OptionTextList = {}
  156.  
  157.     ;
  158.     ; Check if the language requested is supported
  159.     ;
  160.     set LanguageList = ^(LanguagesSupported, 1)
  161.     Ifcontains(i) $($0) in $(LanguageList)
  162.     ;
  163.     ; Check if the platforms requested is supported
  164.     ;
  165.     ifstr(i) $($1) == ""
  166.             goto returnoptions
  167.     endif
  168.  
  169.     set PlatformList = ^(PlatformsSupported, 1)
  170.     Ifcontains(i) $($1) in $(PlatformList)
  171.             goto returnoptions
  172.     else
  173.             set Status = STATUS_NOTSUPPORTED
  174.             goto finish_ReturnOptions
  175.     endif
  176.     else
  177.         set Status = STATUS_NOLANGUAGE
  178.         goto finish_ReturnOptions
  179.     endif
  180.  
  181.     ;
  182.     ; form a list of all the options and another of the text representing
  183.     ;
  184.  
  185. returnoptions = +
  186.     set OptionList     = ^(Options, 1)
  187.     set OptionTextList = ^(OptionsText$($0), 1)
  188.     set Status         = STATUS_SUCCESSFUL
  189.  
  190. finish_ReturnOptions = +
  191.     Return $(Status) $(OptionList) $(OptionTextList)
  192.  
  193. ;------------------------------------------------------------------------
  194. ;
  195. ; InstallOption:
  196. ;
  197. ;      This section is shelled to by main installation processing
  198. ;      or by NCPASHEL.INF during reconfig, removal, update, etc.
  199. ;
  200. ;
  201. ; FUNCTION:  To copy files representing Options
  202. ;            To configure the installed option
  203. ;            To update the registry for the installed option
  204. ;
  205. ; INPUT:     $($0):  Language to use
  206. ;            $($1):  OptionID to install
  207. ;            $($2):  SourceDirectory
  208. ;            $($3):  AddCopy  (YES | NO)
  209. ;            $($4):  DoCopy   (YES | NO)
  210. ;            $($5):  DoConfig (YES | NO)
  211. ;
  212. ; OUTPUT:    $($R0): STATUS: STATUS_SUCCESSFUL |
  213. ;                            STATUS_NOLANGUAGE |
  214. ;                            STATUS_USERCANCEL |
  215. ;                            STATUS_FAILED
  216. ;
  217. ;------------------------------------------------------------------------
  218. [InstallOption]
  219.     ;
  220.     ; Set default values for
  221.     ;
  222.     set Status   = STATUS_FAILED
  223.     ;
  224.     ; extract parameters
  225.     ;
  226.     set Option   = $($1)
  227.     set SrcDir   = $($2)
  228.     set AddCopy  = $($3)
  229.     set DoCopy   = $($4)
  230.     set DoConfig = $($5)
  231.  
  232.     Set !DebugOutputControl = 1
  233.  
  234.     ;
  235.     ; Check if the language requested is supported
  236.     ;
  237.     set LanguageList = ^(LanguagesSupported, 1)
  238.     Ifcontains(i) $($0) NOT-IN $(LanguageList)
  239.     Return STATUS_NOLANGUAGE
  240.     endif
  241.  
  242.     set-subst LF = "\n"
  243.  
  244.     read-syms GeneralConstants
  245.     read-syms AllFileConstants
  246.     read-syms FileConstants"-"$(Option)
  247.     read-syms DialogConstants$(!STF_LANGUAGE)"-"$(Option)
  248.     ifstr(i) $(!NTN_Origination) == "NCPA"
  249.     set Continue = $(OK)
  250.     endif
  251.  
  252.     read-syms AllFileConstants$(!STF_LANGUAGE)
  253.     read-syms FileConstants$(!STF_LANGUAGE)"-"$(Option)
  254.  
  255.     detect date
  256.  
  257.     set-title  $(FunctionTitle)
  258.  
  259.     set to   = Begin
  260.     set from = Begin
  261. ;
  262. ;  Assume all is well.
  263. ;
  264.     set CommonStatus = STATUS_SUCCESSFUL
  265.  
  266.     EndWait
  267.  
  268. ;
  269. ;   Set up the operation-mode-based variables and gaily welcome
  270. ;   the user.  If the "install mode" variable is improperly set,
  271. ;   assume this is a new installation.
  272. ;
  273.  
  274. Begin = +
  275.     Set ActivateDetection = FALSE
  276.  
  277.     Ifstr(i) $(!NTN_InstallMode) == deinstall
  278.     set StartLabel = removeadapter
  279.     else-Ifstr(i) $(!NTN_InstallMode) == Update
  280.     set StartLabel = UpgradeSoftware
  281.     else-Ifstr(i) $(!NTN_InstallMode) == bind
  282.     set StartLabel = bindingadapter
  283.     else-Ifstr(i) $(!NTN_InstallMode) == configure
  284. ;        set ActivateDetection = TRUE
  285.     set StartLabel = configureadapter
  286.     ;
  287.     ;   You cannot config the software component
  288.     ;
  289.     Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  290.         Debug-Output "Cannot configure the CE/A server software."
  291.         Shell $(UtilityInf),RegistryErrorString,CANNOT_CONFIGURE_SOFTWARE
  292.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  293.         Debug-Output "ShellCode error: cannot get an error string."
  294.         goto ShellCodeError
  295.         endif
  296.         set Error = $($R0)
  297.         set from = end
  298.         set to = end
  299.         goto nonfatalinfo
  300.     endif
  301.     else
  302. ;        set ActivateDetection = TRUE
  303.     set StartLabel = installadapter
  304.     set OEM_ABANDON_OPTIONS = {}
  305.     set OEM_ABANDON_SOFTWARE = FALSE
  306.     set OEM_ABANDON_ON = TRUE
  307.     endif
  308.  
  309.  
  310.     ;  set the [Default values]
  311.  
  312.     set IRQValue                     = *($(IRQList), 5)                    ; IRQ Level      = 10
  313.     set IOBaseAddrValue              = *($(IOBaseAddrList), 1)           ; IOBase Address = 0x200  pcmcia asks for 7f io ports with multifunction!
  314.     set MemoryAddrValue              = *($(MemoryAddrList), 49)          ; Memory Address =     0xD1000
  315.     set ModemIOBaseAddressValue       = *($(ModemIOBaseAddressList), 2)     ; IOBase Address = 0x2F8
  316.     set ModemInterruptNumberValue     = *($(IRQList), 1)                     ; int = 3
  317.     set SocketNumberValue             = *($(SocketNumberList), 1)            ; SocketNumber = 1
  318.                                               
  319.     Set from = $(fatal)
  320.     Set to = $(fatal)
  321.     Goto $(StartLabel)
  322.  
  323. ;-----------------------------------------------
  324. ; Installation Section
  325. ;-----------------------------------------------
  326.  
  327. installadapter = +
  328. ;
  329. ;   First, check whether the same version of the software exists
  330. ;
  331.     OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  332.  
  333.     Ifstr $(KeyProduct) != $(KeyNull)
  334.     ;
  335.     ; Same version already existed in the local machine
  336.     ; Popup the dialog and ask the user whether he wants to continue
  337.     ;
  338.     CloseRegKey $(KeyProduct)
  339.  
  340.     ifstr(i) !(NTN_RegBase) == $(ProductKeyName)
  341.        ;
  342.        ; Cannot Install the same software again
  343.        ;
  344.        Shell $(UtilityInf), VerExistedDlg, $(ProductSoftwareTitle),+
  345.            $(ProductVersion)
  346.        ifint $($ShellCode) != $(!SHELL_CODE_OK)
  347.            Debug-Output "ShellCode error: cannot get an error string."
  348.            goto ShellCodeError
  349.        endif
  350.  
  351.        goto end
  352.     else
  353.        ;
  354.        ; Add a new adapter card?
  355.        ;
  356.        Shell $(UtilityInf), CardExistedDlg
  357.  
  358.        ifint $($ShellCode) != $(!SHELL_CODE_OK)
  359.            Debug-Output "ShellCode error: cannot get an error string."
  360.            goto ShellCodeError
  361.        endif
  362.  
  363.        ifstr(i) $($R1) != "OK"
  364.            goto end
  365.        endif
  366.        set OldVersionExisted = $(TRUE)
  367.     endif
  368.     endif
  369.  
  370. ;
  371. ;  dll load addition
  372. ;
  373.     Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) NO
  374.  
  375.     Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  376.     Goto ShellCodeError
  377.     Else-Ifstr(i) $($R0) == STATUS_FAILED
  378.     Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
  379.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  380.         goto ShellCodeError
  381.     endif
  382.     set Error = $($R0)
  383.     Goto fatal
  384.     Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
  385.     Goto successful
  386.     Endif
  387.  
  388.     Set SrcDir = $($R1)
  389.  
  390.     install "Install-Dll"
  391.  
  392.     goto adaptersetup
  393.  
  394. ;-----------------------------------------------
  395. ; Configuration Section
  396. ;-----------------------------------------------
  397. ;
  398. ;   Get the current values of all the parameters
  399. ;
  400. configureadapter = +
  401.     Ifstr $(KeyProduct) == $(KeyNull)
  402.     OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) $(MAXIMUM_ALLOWED) KeyProduct
  403.     Ifstr $(KeyProduct) == $(KeyNull)
  404.         set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
  405.         Debug-Output "Cannot find component product key"
  406.         goto fatalregistry
  407.     Endif
  408.     Endif
  409.  
  410.     ;
  411.     ; Get the other parameters;  they're attached to the service parameters key
  412.     ;
  413.     Debug-Output "INF: Shelling to FindService"
  414.     Shell $(UtilityInf) FindService, $(KeyProduct)
  415.     Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  416.     Debug-Output "INF: FindService shell failure"
  417.     Goto ShellCodeError
  418.     Endif
  419.     Ifstr(i) $($R0) != NO_ERROR
  420.     Debug-Output "INF: FindService Shell error: "$($R0)
  421.     Goto fatalregistry
  422.     endif
  423.  
  424.     Set KeyParameters = $($R2)
  425.  
  426.     ;
  427.     ;  We don't need the services key, so close it.
  428.     ;
  429.     CloseRegKey $($R1)
  430.  
  431.     Ifstr $(KeyParameters) == $(KeyNull)
  432.     set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
  433.     Debug-Output "Cannot find component service"
  434.     goto fatalregistry
  435.     endif
  436.  
  437.     set OldVersionExisted = $(TRUE)
  438.  
  439.     set ValueName = ""
  440.     set ValueData = ""
  441.     set ValueStr  = ""
  442.     set ValueList = {}
  443.  
  444.  
  445.     ;
  446.     ; Get the old values from the Registry      [Get Values]
  447.     ; *********************************************************
  448.     EnumRegValue $(KeyParameters) ValueList
  449.  
  450.  
  451.  
  452.     ForListDo $(ValueList)
  453.         set ValueItem = $($)
  454.         set ValueName = *($(ValueItem),1)
  455.         set ValueData = *($(ValueItem),4)
  456.         ifstr(i) $(ValueName) == "IoBaseAddress"        
  457.             set IOBaseAddrIndex = $(ValueData)
  458.         else-ifstr(i) $(ValueName) == "PCCARDReadyInterrupt"
  459.             set IRQValueIndex = $(ValueData)
  460.         else-ifstr(i) $(ValueName) == "PCCARDAttributeMemoryAddress"
  461.             set MemoryAddrIndex = $(ValueData)
  462.         else-ifstr(i) $(ValueName) == "IOBaseAddress_1"
  463.             set ModemIOBaseAddressIndex = $(ValueData)
  464.         else-ifstr(i) $(ValueName) == "InterruptNumber"
  465.             set ModemInterruptNumberIndex = $(ValueData)
  466.         else-ifstr(i) $(ValueName) == "ControllerType"
  467.             set SocketNumberIndex = $(ValueData)
  468.         endif
  469.     EndForListDo
  470.  
  471.     set IRQValue = *($(IRQList), ~($(IRQValues),$(IRQValueIndex)))
  472.     ifstr(i) $(IRQValue) == ""
  473.         set IRQValue = *($(IRQList), 2)
  474.     endif
  475.  
  476.     set MemoryAddrValue = *($(MemoryAddrList), ~($(MemoryAddrValues),$(MemoryAddrIndex)))
  477.     ifstr(i) $(MemoryAddrValue) == ""
  478.         set MemoryAddrValue = *($(MemoryAddrValues), 2)
  479.     endif
  480.  
  481.     set IOBaseAddrValue = *($(IOBaseAddrList), ~($(IOBaseAddrValues),$(IOBaseAddrIndex)))
  482.     ifstr(i) $(IOBaseAddrValue) == ""
  483.         set IOBaseAddrValue = *($(IOBaseAddrList), 1)     
  484.     endif
  485.  
  486.     set ModemIOBaseAddressValue = *($(ModemIOBaseAddressList), ~($(ModemIOBaseAddressValues),$(ModemIOBaseAddressIndex)))
  487.     ifstr(i) $(ModemIOBaseAddressValue) == ""
  488.         set ModemIOBaseAddressValue = *($(ModemIOBaseAddressList), 2)     
  489.     endif
  490.  
  491.     set ModemInterruptNumberValue = *($(IRQList), ~($(IRQValues),$(ModemInterruptNumberIndex)))
  492.     ifstr(i) $(ModemInterruptNumberValue) == ""
  493.         set ModemInterruptNumberValue = *($(IRQList), 1)          
  494.     endif
  495.  
  496.     set SocketNumberValue = *($(SocketNumberList), ~($(SocketNumberValues),$(SocketNumberIndex)))
  497.     ifstr(i) $(SocketNumberValue) == ""
  498.         set SocketNumberValue = *($(SocketNumberList), 1)         
  499.     endif
  500.  
  501.  
  502.  
  503.     ;  Save the settings as they were read from the Registry.
  504.  
  505. ;    Shell $(ParamInf) Param_SaveValues
  506. ;    Set CurrParamSettings = $($R0)
  507. ;
  508. ;   Put up the adapter configuration dialog if necessary.
  509. ;
  510. ;   Note that $(CurrParamSettings) has the old known parameter values.
  511. ;
  512. adaptersetup = +
  513.  
  514.  
  515.     ;Shell "" DebugConfiguration "before displaying dialog"
  516.  
  517.     Set from = adapteroptions
  518.  
  519.  
  520. adapteroptions = +
  521.  
  522.     LoadLibrary "disk 1" $(DialogDllName) hLib
  523.     read-syms FileDependentDlg$(!STF_LANGUAGE)"-"$(Option)                
  524.     ui start "InputDlg"  $(hLib)
  525.     set ExitButton      = $(ButtonPressed)
  526.     ;Debug-Output " ButtonPressed "$(ButtonPressed)
  527.     ;Debug-Output " DLGEVENT "$(DLGEVENT)
  528.     FreeLibrary $(hLib)
  529.     
  530.     ifstr(i) $(DLGEVENT) == "CONTINUE"
  531.      
  532.         set IOBaseAddrIndex  = $(Combo1Out)
  533.         set MemoryAddrIndex  = $(Combo2Out)
  534.         set IRQValueIndex    = $(Combo3Out)
  535.         set ModemIOBaseAddressIndex = $(Combo4Out)
  536.         set ModemInterruptNumberIndex = $(Combo5Out)
  537.         set SocketNumberIndex = $(Combo6Out)
  538.         set ExitButton       = $(ButtonPressed)
  539.         ui pop 1
  540.         ;goto nextstep
  541.  
  542.     else-ifstr(i) $(DLGEVENT) == "EXIT"
  543.         set CommonStatus = STATUS_USERCANCEL
  544.         ui pop 1
  545.         goto end
  546.     else
  547.         set CommonStatus = STATUS_USERCANCEL
  548.         ui pop 1
  549.         Debug-Output "Action: unknown. Bye."
  550.         goto end
  551.     endif
  552.  
  553.  
  554. ;
  555. ;   If installing, go create the necessary keys;
  556. ;   if configuring, they're already open.
  557. ;
  558. skipoptions =+
  559.  
  560.     ifint $(OldVersionExisted) == $(TRUE)
  561.     ifstr(i) $(!NTN_InstallMode) == configure
  562.         goto writeparameters
  563.     endif
  564.     endif
  565.     StartWait
  566.     ;
  567.     ; Add Software Component
  568.     ;
  569.     ifint $(OldVersionExisted) == $(FALSE)
  570.  
  571.     ifstr(i) $(!NTN_InstallMode) == "install"
  572.        Ifstr(i) $(DoCopy) == "YES"
  573.  
  574.           Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) YES
  575.  
  576.           Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  577.           Goto ShellCodeError
  578.           Else-Ifstr(i) $($R0) == STATUS_FAILED
  579.           Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
  580.           ifint $($ShellCode) != $(!SHELL_CODE_OK)
  581.               goto ShellCodeError
  582.           endif
  583.           set Error = $($R0)
  584.           Goto fatal
  585.           Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
  586.           Goto successful
  587.           Endif
  588.  
  589.           Set SrcDir = $($R1)
  590.  
  591.        Endif
  592.  
  593.        install "Install-Option"
  594.  
  595.        ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  596.           Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
  597.           ifint $($ShellCode) != $(!SHELL_CODE_OK)
  598.           goto ShellCodeError
  599.           endif
  600.           set Error = $($R0)
  601.           goto fatal
  602.        endif
  603.     endif
  604.  
  605.  
  606.  
  607.     Shell $(UtilityInf), AddSoftwareComponent, $(Manufacturer), +
  608.         $(ProductSoftwareName), +
  609.         $(ProductSoftwareName), +
  610.         $(ProductSoftwareTitle), $(STF_CONTEXTINFNAME), +
  611.         $(ProductSoftwareImagePath), "kernel", "NDIS", {}, "",+
  612.         $(NetEventDLL)
  613.  
  614.     Set OEM_ABANDON_SOFTWARE = TRUE
  615.  
  616.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  617.         Debug-Output "ShellCode error"
  618.         goto ShellCodeError
  619.     endif
  620.     ;
  621.     ;   At this point:
  622.     ;     $R1 contains the product version key handle;
  623.     ;     $R2 contains the NetRules subkey handle;
  624.     ;     $R3 contains the new Services key handle; and
  625.     ;     $R4 contains the Parameters key
  626.     ;     $R5 contains the Linkage Key
  627.     ;
  628.     set RegistryErrorIndex = $($R0)
  629.     set KeyProduct      = $($R1)
  630.     Set SoftNetRulesKey = $($R2)
  631.     CloseRegKey $($R3)
  632.     CloseRegKey $($R4)
  633.     CloseRegKey $($R5)
  634.  
  635.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  636.         EndWait
  637.         Debug-Output "Registry error: add software components"
  638.         CloseRegKey $(KeyProduct)
  639.         CloseRegKey $(SoftNetRulesKey)
  640.         goto fatalregistry
  641.     endif
  642.  
  643.     set NewValueList = {{SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(SoftwareType)},+
  644.                {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
  645.                {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
  646.                {Title,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareTitle)},+
  647.                {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareDescription)},+
  648.                {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareName)},+
  649.                {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  650.  
  651.     Shell  $(UtilityInf), AddValueList, $(KeyProduct), $(NewValueList)
  652.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  653.         Debug-Output "ShellCode error."
  654.         goto ShellCodeError
  655.     endif
  656.  
  657.     set RegistryErrorIndex = $($R0)
  658.  
  659.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  660.         EndWait
  661.         Debug-Output "Registry error: add value list."
  662.         CloseRegKey $(KeyProduct)
  663.         CloseRegKey $(SoftNetRulesKey)
  664.         goto fatalregistry
  665.     endif
  666.  
  667.     set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareType)},+
  668.                 {use,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareUse)}, +
  669.                 {bindform,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareBindForm)}, +
  670.                 {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareClass)}, +
  671.                 {bindable,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareBindable)}, +
  672.                 {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  673.  
  674.     Shell  $(UtilityInf), AddValueList, $(SoftNetRulesKey), $(NewValueList)
  675.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  676.         Debug-Output "ShellCode error."
  677.         goto ShellCodeError
  678.     endif
  679.  
  680.     set RegistryErrorIndex = $($R0)
  681.  
  682.     CloseRegKey $(KeyProduct)
  683.     CloseRegKey $(SoftNetRulesKey)
  684.  
  685.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  686.         EndWait
  687.         Debug-Output "Resgitry error: add value list."
  688.         goto fatalregistry
  689.     endif
  690.     endif
  691. ;
  692. ;   Create the HARDWARE\Netcard region and its corresponding service
  693. ;
  694.     Shell $(UtilityInf), AddHardwareComponent, $(ProductHardwareName),$(STF_CONTEXTINFNAME),$(ProductKeyName)
  695.  
  696.     ifint $($R4) != -1
  697.     Set OEM_ABANDON_OPTIONS = >($(OEM_ABANDON_OPTIONS), $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards\"$($R4))
  698.     endif
  699.  
  700.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  701.     Debug-Output "Cannot add hardware component"
  702.     goto ShellCodeError
  703.     endif
  704.  
  705.     set RegistryErrorIndex = $($R0)
  706.  
  707.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  708.     EndWait
  709.     Debug-Output "Registry error: add hardware component"
  710.     CloseRegKey $($R1)
  711.     CloseRegKey $($R2)
  712.     CloseRegKey $($R3)
  713.     goto fatalregistry
  714.     endif
  715.  
  716. ;
  717. ;   At this point:
  718. ;     $R1  Registry key variable for HARDWARE\Netcard\(n)
  719. ;     $R2  Registry key variable for HARDWARE\Netcard\(n)\\NetRules
  720. ;     $R3  Registry key handle for <service>\Parameters key
  721. ;     $R4  Adapter number assigned to adapter
  722. ;     $R5  Service name generated by combining svc name with adapter number
  723. ;
  724.     set KeyParameters = $($R3)
  725.     set KeyAdapterRules = $($R2)
  726.     set AdapterNumber = $($R4)
  727.  
  728.     set NewValueList = {{Manufacturer,$(NoTitle),$(!REG_VT_SZ),$(Manufacturer)},+
  729.                {Title,$(NoTitle),$(!REG_VT_SZ),"["$($R4)"] "$(ProductHardwareTitle)},+
  730.                {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareDescription)},+
  731.                {ProductName,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareName)},+
  732.                {ServiceName,$(NoTitle),$(!REG_VT_SZ),$($R5)},+
  733.                {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  734.  
  735.     Shell  $(UtilityInf), AddValueList, $($R1), $(NewValueList)
  736.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  737.     Debug-Output "ShellCode error"
  738.     goto ShellCodeError
  739.     endif
  740.  
  741.     CloseRegKey $($R1)
  742.  
  743.     set TempProdName = """"$(ProductHardwareName)$(AdapterNumber)""""
  744.     set TempBindForm = $(TempProdName)$(NetRuleHardwareBindForm)
  745.  
  746.     set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleHardwareType)},+
  747.             {bindform,$(NoTitle),$(!REG_VT_SZ),$(TempBindForm)}, +
  748.             {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleHardwareClass)}, +
  749.             {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  750.  
  751.     Shell  $(UtilityInf), AddValueList, $(KeyAdapterRules), $(NewValueList)
  752.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  753.     Debug-Output "ShellCode error."
  754.     goto ShellCodeError
  755.     endif
  756.  
  757.     set RegistryErrorIndex = $($R0)
  758.  
  759.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  760.     EndWait
  761.     Debug-Output "Resgitry error: add value list."
  762.     CloseRegKey $(KeyParameters)
  763.     CloseRegKey $(KeyAdapterRules)
  764.     goto fatalregistry
  765.     endif
  766.  
  767.     CloseRegKey $(KeyAdapterRules)
  768.  
  769.     goto writeparameters
  770. ;
  771. ;   REQUIRED:   $(KeyParameters) contains service Parameters key handle
  772. ;
  773. writeparameters = +
  774.     Shell $(UtilityInf), GetBusTypeNum
  775.     set BusTypeNum = $($R1)
  776.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  777.     Debug-Output "ShellCode error."
  778.     goto ShellCodeError
  779.     endif
  780. ;
  781. ;   Add the rest of the parameters to the Services area
  782. ;
  783.  
  784.     set MemoryAddrValue  = *($(MemoryAddrValues),  ~($(MemoryAddrList), $(MemoryAddrIndex)))    
  785.     set IRQValue         = *($(IRQValues),         ~($(IRQList),        $(IRQValueIndex)))
  786.     set IOBaseAddrValue  = *($(IOBaseAddrValues),  ~($(IOBaseAddrList), $(IOBaseAddrIndex)))         
  787.     set ModemIOBaseAddressValue  = *($(ModemIOBaseAddressValues),  ~($(ModemIOBaseAddressList), $(ModemIOBaseAddressIndex)))         
  788.     set ModemInterruptNumberValue  = *($(ModemInterruptNumberValues),  ~($(ModemInterruptNumberList), $(ModemInterruptNumberIndex)))         
  789.     set SocketNumberValue  = *($(SocketNumberValues),  ~($(SocketNumberList), $(SocketNumberIndex)))         
  790.     set IOLengthValue    = 31       
  791.     set NewValueList     = {{IoBaseAddress,           $(NoTitle),$(!REG_VT_DWORD),$(IOBaseAddrValue)},+      
  792.                             {IoLength,                $(NoTitle),$(!REG_VT_DWORD), $(IOLengthValue)},+
  793.                             {PCCARDAttributeMemoryAddress, $(NoTitle),$(!REG_VT_DWORD),$(MemoryAddrValue)},+
  794.                             {PCCARDAttributeMemorySize,    $(NoTitle),$(!REG_VT_DWORD),4096},+
  795.                             {PCCARDAttributeMemoryOffset,  $(NoTitle),$(!REG_VT_DWORD),0},+
  796.                             {PCCARDReadyInterrupt,    $(NoTitle),$(!REG_VT_DWORD),$(IRQValue)},+
  797.                             {ResourceManager,         $(NoTitle),$(!REG_VT_SZ),TRUE},+
  798.                             {MediaType,               $(NoTitle),$(!REG_VT_DWORD),1},+
  799.                             {BusType,                 $(NoTitle),$(!REG_VT_DWORD),$(BusTypeNum)},+
  800.                             {BusNumber,               $(NoTitle),$(!REG_VT_DWORD),0},+
  801.                             {ResourceManager,         $(NoTitle),$(!REG_VT_DWORD),1},+
  802.                             {IoBaseAddress_1,         $(NoTitle),$(!REG_VT_DWORD),$(ModemIOBaseAddressValue)},+          
  803.                             {IoLength_1,              $(NoTitle),$(!REG_VT_DWORD), 7},+
  804.                             {InterruptNumber,         $(NoTitle),$(!REG_VT_DWORD),$(ModemInterruptNumberValue)},+
  805.                             {ControllerType,          $(NoTitle),$(!REG_VT_DWORD),$(SocketNumberValue)},+
  806.                             {PCMCIA,                  $(NoTitle),$(!REG_VT_DWORD),1}}                      
  807.  
  808.     
  809.     Shell  $(UtilityInf), AddValueList, $(KeyParameters), $(NewValueList)
  810.     CloseRegKey $(KeyParameters)
  811.  
  812.        ; --------------------------------------------------------------------------------
  813.     ; Write the parameters to the PCMCIA database section, iff running MS Enabler
  814.     ; Add/replace only the parts for the CEM2
  815.     ; --------------------------------------------------------------------------------
  816.     set PCMCIADatabaseKeyName = $(!NTN_ServiceBase)"\Pcmcia\DataBase"
  817.     set PCMCIADatabaseXircomKeyName = $(PCMCIADatabaseKeyName)"\Xircom"
  818.     OpenRegKey $(!REG_H_LOCAL) "" $(PCMCIADatabaseKeyName) $(MAXIMUM_ALLOWED) PCMCIADatabaseKey
  819.  
  820.     ifstr $(PCMCIADatabaseKey) == $(NULL)
  821.         ;Debug-Output "Pcmcia\DataBase not present"
  822.     else ; PCMCIA.sys is installed and registry has database section in it.
  823.         ; Try to open Xircom section.  Delete it if found
  824.         OpenRegKey $(!REG_H_LOCAL) "" $(PCMCIADatabaseKeyName)"\Xircom" $(MAXIMUM_ALLOWED) PCMCIADatabaseXircomKey
  825.         ifstr $(PCMCIADatabaseXircomKey) == $(NULL) ; open failed, so create Xircom subkey
  826.             CreateRegKey $(PCMCIADatabaseKey) {"Xircom", 0, 0} "" $(MAXIMUM_ALLOWED) "" PCMCIADatabaseXircomKey
  827.         endif
  828.  
  829.         ; Open "CreditCard Ethernet+Modem II"  aka $(VERS1Product) ----------------------------------------------------------------------
  830.         OpenRegKey $(!REG_H_LOCAL) "" $(PCMCIADatabaseXircomKeyName)"\"$(VERS1Product) $(MAXIMUM_ALLOWED) PCMCIADatabaseXircomCEM2Key
  831.         ifstr $(PCMCIADatabaseXircomCEM2Key) == $(NULL)
  832.             CreateRegKey $(PCMCIADatabaseXircomKey) {$(VERS1Product), 0, 0} "" $(MAXIMUM_ALLOWED) 0 PCMCIADatabaseXircomCEM2Key
  833.         endif
  834.  
  835.         ; Write the ONE entry for CEM2 --------------------------------------------------------------------------------------
  836.         SetRegValue $(PCMCIADatabaseXircomCEM2Key) {Driver, 0, $(!REG_VT_SZ),"cm2ndis3"}
  837.         SetRegValue $(PCMCIADatabaseXircomCEM2Key) {AttributeMemorySize, 0, $(!REG_VT_DWORD),4096}
  838.         SetRegValue $(PCMCIADatabaseXircomCEM2Key) {DeviceType, 0, $(!REG_VT_SZ),"NET"}
  839.         CloseRegKey $(PCMCIADatabaseXircomCEM2Key)
  840.         CloseRegKey $(PCMCIADatabaseXircomKey)
  841.         CloseRegKey $(PCMCIADatabaseKey)
  842.     endif
  843.  
  844.  
  845.     ; --------------------------------------------------------------------------------
  846.     ; --------------------------------------------------------------------------------
  847.     
  848.     
  849.     ; --------------------------------------------------------------------------------
  850.     ; Inform CEM2 user he has to manually add serial port through control panel
  851.     ; --------------------------------------------------------------------------------
  852.     ;ifstr(i) $(Option) == CM2NDIS3
  853.     ;       set InvokePortCPMsg   = "Xircom CEM-2 setup is complete. Please configure the CEM-2 serial port "+
  854.     ;                               "by invoking the Ports control panel."
  855.     ;       Shell "subroutn.inf" SetupMessage, $(!STF_LANGUAGE), "STATUS", $(InvokePortCPMsg)
  856.     ;   IfInt $($ShellCode) != $(!SHELL_CODE_OK)
  857.     ;        GoTo SuccessfulOption
  858.     ;    EndIf
  859.     ;endif
  860.  
  861.  
  862.  
  863.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  864.     Debug-Output "ShellCode error."
  865.     goto ShellCodeError
  866.     endif
  867.  
  868.     set RegistryErrorIndex = $($R0)
  869.  
  870.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  871.     Debug-Output "Registry error: Add value list"
  872.     goto fatalregistry
  873.     endif
  874.  
  875.     EndWait
  876.  
  877.     goto successful
  878.  
  879. ;-----------------------------------------------
  880. ; Binding section
  881. ;-----------------------------------------------
  882. bindingadapter =+
  883.     set Error = "Binding: Sorry, not yet implemented."
  884.     goto fatal
  885.  
  886. ;-----------------------------------------------
  887. ; Removeadapter section
  888. ;-----------------------------------------------
  889.  
  890. removeadapter = +
  891.     Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  892.     ; Remove Software Component
  893.     Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  894.         $(ProductSoftwareName)
  895.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  896.         Debug-Output "ShellCode error"
  897.         goto ShellCodeError
  898.     endif
  899.  
  900.     set RegistryErrorIndex = $($R0)
  901.  
  902.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  903.         goto fatalregistry
  904.     endif
  905.     else
  906.     Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  907.         $(ProductSoftwareName), $(!NTN_RegBase)
  908.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  909.         Debug-Output "ShellCode error"
  910.         goto ShellCodeError
  911.     endif
  912.  
  913.     set RegistryErrorIndex = $($R0)
  914.  
  915.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  916.         goto fatalregistry
  917.     endif
  918.     endif
  919.  
  920.     goto end
  921.  
  922. ;-----------------------------------------------
  923. ; Upgrade Software section
  924. ;-----------------------------------------------
  925.  
  926. UpgradeSoftware = +
  927.     ;
  928.     ; First determine whether we want to do upgrade or update for software
  929.     ; or hardware component. Then we will determine whether the Mode is
  930.     ; update or upgrade.
  931.     ;
  932.     ; If the same version of the product existed in the registry, we do
  933.     ; update. Otherwise, we will do a upgrade
  934.     ;
  935.     ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  936.     ; Upgrade software component
  937.     ;
  938.     ; see whether the same version exist or not
  939.     ;
  940.     OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  941.  
  942.     Ifstr $(KeyProduct) != $(KeyNull)
  943.         GetRegValue $(KeyProduct),"MajorVersion", VersionInfo
  944.         set Version = *($(VersionInfo), 4)
  945.  
  946.         ;
  947.         ; Update the binaries
  948.         ;
  949.         Shell $(UtilityInf), GetInfFileNameFromRegistry, $(KeyProduct)
  950.  
  951.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  952.         Debug-Output "ShellCode error"
  953.         goto ShellCodeError
  954.         endif
  955.  
  956.         set !UG_Filename = $($R0)
  957.  
  958.         ifstr(i) $(!UG_Filename) != ""
  959.         install "Install-Update"
  960.         ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  961.             goto fatal
  962.         endif
  963.         endif
  964.  
  965.         ; Upgrade the version number
  966.         ;
  967.         SetRegValue $(KeyProduct) {MajorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMajorVersion)}
  968.         SetRegValue $(KeyProduct) {MinorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMinorVersion)}
  969.  
  970.         ;
  971.         ; do nothing for update
  972.         ;
  973.         ifint $(Version) != $(ProductVersion)
  974.            ;
  975.            ; If the major version number is not the same,
  976.            ; it is major upgrade. So let Upgrade the product
  977.            ;
  978.            ;
  979.            ; make other upgrade change if necessary
  980.            ;
  981.         endif
  982.         CloseRegKey $(KeyProduct)
  983.     else
  984.         ;
  985.         ; Cannot Open software key, goto ERROR
  986.         ;
  987.         goto fatalregistry
  988.     endif
  989.     else
  990.     ;
  991.     ; upgrade/update hardware component
  992.     ; There is no different between upgrade and update for hardware
  993.     ; component
  994.     ;
  995.     ; 1. Get the Service Name
  996.     ; 2. Change the NetRule section if necessary
  997.     ;
  998.     OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) +
  999.           $(MAXIMUM_ALLOWED) NetworkCardKey
  1000.     Ifstr(i) $(NetworkCardKey) != $(KeyNull)
  1001.         ;
  1002.         ; Get Service name
  1003.         ;
  1004.         GetRegValue $(NetworkCardKey),"ServiceName", ServiceNameInfo
  1005.         set ServiceName = *($(ServiceNameInfo), 4)
  1006.  
  1007.         ;
  1008.         ; Change the NetRule if necessary
  1009.         ;
  1010.         OpenRegKey $(NetworkCardKey) "" "NetRules" +
  1011.         $(MAXIMUM_ALLOWED) NetRuleKey
  1012.         Ifstr(i) $(NetRuleKey) != $(KeyNull)
  1013.         ;
  1014.         ; Make the change....
  1015.         ;
  1016.         else
  1017.         ;
  1018.         ; Error, cannot open net rules key
  1019.         ;
  1020.         goto fatalregistry
  1021.         endif
  1022.  
  1023.         CloseRegKey $(NetRules)
  1024.         CloseRegKey $(NetworkCardKey)
  1025.     else
  1026.         ;
  1027.         ; Error, cannot open network card key
  1028.         ;
  1029.         goto fatalregistry
  1030.     endif
  1031.     ;
  1032.     ; 3. Change the service section of the hardware. i.e.,
  1033.     ;    ParameterName change, value change, etc.
  1034.     ;
  1035.     OpenRegKey $(!REG_H_LOCAL) "" +
  1036.           $(!NTN_ServiceBase)"\"$(ServiceName) +
  1037.           $(MAXIMUM_ALLOWED) ServiceKey
  1038.  
  1039.     Ifstr(i) $(ServiceKey) != $(KeyNull)
  1040.         ;
  1041.         ; Get the ServiceKey to change the Start value
  1042.         ; or Type value. Or open Parameters key to
  1043.         ; change the hardware parameters if necessary.
  1044.         ;
  1045.         CloseRegKey $(ServiceKey)
  1046.     else
  1047.         ;
  1048.         ; Error, cannot open network card key
  1049.         ;
  1050.         goto fatalregistry
  1051.     endif
  1052.     endif
  1053.  
  1054.     goto end
  1055.     ;
  1056.     ; End of Upgrade Software
  1057.     ;
  1058.  
  1059. ;
  1060. ;  Escape hatches
  1061. ;
  1062. successful = +
  1063.     goto end
  1064.  
  1065. abandon = +
  1066.     ForListDo $(OEM_ABANDON_OPTIONS)
  1067.     Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  1068.         $(ProductSoftwareName), $($)
  1069.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1070.         Debug-Output "ShellCode error"
  1071.         goto ShellCodeError
  1072.     endif
  1073.  
  1074.     set RegistryErrorIndex = $($R0)
  1075.  
  1076.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1077.         goto fatalregistry
  1078.     endif
  1079.     EndForListDo
  1080.  
  1081.     Ifstr(i) $(OEM_ABANDON_SOFTWARE) == TRUE
  1082.     ; Remove Software Component
  1083.     Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  1084.         $(ProductSoftwareName), FALSE
  1085.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1086.         Debug-Output "ShellCode error"
  1087.         goto ShellCodeError
  1088.     endif
  1089.  
  1090.     set RegistryErrorIndex = $($R0)
  1091.  
  1092.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1093.         goto fatalregistry
  1094.     endif
  1095.     endif
  1096.  
  1097.     goto end
  1098.  
  1099. ;
  1100. ; warning display
  1101. ;
  1102. warning = +
  1103.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "WARNING", $(Error)
  1104.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1105.     goto ShellCodeError
  1106.     endif
  1107.     ifstr(i) $($R1) == "OK"
  1108.     goto $(to)
  1109.     else-ifstr(i) $($R1) == "CANCEL"
  1110.     goto $(from)
  1111.     else
  1112.     goto "end"
  1113.     endif
  1114. ;
  1115. ; non fatal error display
  1116. ;
  1117. nonfatalinfo = +
  1118.     Set Severity = STATUS
  1119.     Set CommonStatus = STATUS_USERCANCEL
  1120.     goto nonfatalmsg
  1121. nonfatal = +
  1122.     Set Severity = NONFATAL
  1123.     goto nonfatalmsg
  1124. nonfatalmsg = +
  1125.     ifstr(i) $(Error) == ""
  1126.     Set Severity = NONFATAL
  1127.     Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  1128.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1129.         goto ShellCodeError
  1130.     endif
  1131.     set Error = $($R0)
  1132.     endif
  1133.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), $(Severity), $(Error)
  1134.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1135.     goto ShellCodeError
  1136.     endif
  1137.     ifstr(i) $($R1) == "OK"
  1138.     goto $(from)
  1139.     else
  1140.     goto "end"
  1141.     endif
  1142.  
  1143. ;
  1144. ;  Registry is broken
  1145. ;
  1146. fatalregistry = +
  1147.     Shell $(UtilityInf) RegistryErrorString $(RegistryErrorIndex)
  1148.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1149.     goto ShellCodeError
  1150.     endif
  1151.     set Error = $($R0)
  1152.     goto fatal
  1153. ;
  1154. ;  Netcard detection failure
  1155. ;
  1156. fataldetect = +
  1157.     Shell $(UtilityInf),RegistryErrorString,CANNOT_DETECT
  1158.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1159.     Debug-Output "ShellCode error: cannot get an error string."
  1160.     goto ShellCodeError
  1161.     endif
  1162.     set Error = $($R0)
  1163.     Goto fatal
  1164. ;
  1165. ; fatal error display
  1166. ;
  1167. fatal = +
  1168.     ifstr(i) $(Error) == ""
  1169.     Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  1170.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1171.         goto ShellCodeError
  1172.     endif
  1173.     set Error = $($R0)
  1174.     endif
  1175.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
  1176.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1177.     goto ShellCodeError
  1178.     endif
  1179.  
  1180.     goto setfailed
  1181.  
  1182. ;
  1183. ;  Shelling error
  1184. ;
  1185. ShellCodeError = +
  1186.     set DlgType      = "MessageBox"
  1187.     set STF_MB_TITLE = $(ShellCodeErrorTitle)
  1188.     set STF_MB_TEXT  = $(ShellCodeErrorText) 
  1189.     set STF_MB_TYPE  = 1
  1190.     set STF_MB_ICON  = 3
  1191.     set STF_MB_DEF   = 1
  1192.     ui start "Error Message"
  1193.     goto setfailed
  1194.  
  1195. setfailed = +
  1196.     set CommonStatus = STATUS_FAILED
  1197.     ;
  1198.     ; if OEM_ABANDON_ON == TRUE, then remove the registry entries
  1199.     ;
  1200.     ifstr(i) $(OEM_ABANDON_ON) == TRUE
  1201.     set OEM_ABANDON_ON = FALSE
  1202.     goto abandon
  1203.     endif
  1204.     goto end
  1205.  
  1206. end = +
  1207.     goto term
  1208.  
  1209. term = +
  1210.  
  1211.     Return $(CommonStatus)
  1212.  
  1213. [DebugConfiguration]
  1214.  
  1215.     Set InfName = "OEMSETNT.INF"
  1216.     ;Debug-Output $(InfName)" **CONFIGURATION STATE: "$($0)
  1217.     ;Debug-Output $(InfName)" IRQ_Level is "$(!p:IRQ_Level)
  1218.     ;Debug-Output $(InfName)" IOBaseAddrValue is "$(!p:IOBaseAddrValue)
  1219.     ;Debug-Output $(InfName)" TransceiverValue is "$(!p:TransceiverValue)
  1220.     ;Debug-Output $(InfName)" MemoryAddr is "$(!p:MemoryAddr)
  1221.     ;Debug-Output $(InfName)" MappedValue is "$(!p:MappedValue)
  1222.  
  1223.     return
  1224.  
  1225.  
  1226. ;***************************************************************
  1227. ;  INSTALL SECTIONS
  1228. ;***************************************************************
  1229. [Install-Option]
  1230.     set STF_VITAL = ""
  1231.  
  1232.     ifstr(i) $(AddCopy) == "YES"
  1233.  
  1234.     ;
  1235.     ; Add the files to the copy list
  1236.     ;
  1237.     ;  BUGBUG: eliminate the "nt2" in the next line when Sunil fixes
  1238.     ;      the other INF files
  1239.     ;
  1240.     AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  1241.  
  1242.     endif
  1243.  
  1244.     ifstr(i) $(DoCopy) == "YES"
  1245.  
  1246.        ;
  1247.        ; Copy files in the copy list
  1248.        ;
  1249.        set !STF_NCPA_FLUSH_COPYLIST = TRUE
  1250.        CopyFilesInCopyList
  1251.  
  1252.     endif
  1253.  
  1254.     Exit
  1255.  
  1256. [Install-Update]
  1257.    set STF_VITAL        = ""
  1258.    set STF_OVERWRITE    = "VERIFYSOURCEOLDER"
  1259.    ;set STF_VERSION     = "YES"
  1260.  
  1261.    AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  1262.    AddSectionFilesToCopyList Files-Inf $(SrcDir) $(!STF_WINDOWSSYSPATH)
  1263.  
  1264.    set !STF_NCPA_FLUSH_COPYLIST = TRUE
  1265.    CopyFilesInCopyList
  1266.  
  1267.    exit
  1268.  
  1269.  
  1270. [Install-Dll]
  1271.    set STF_VITAL        = ""
  1272.    AddSectionFilesToCopyList Files-Dll $(SrcDir) $(!STF_WINDOWSSYSPATH)
  1273.    set !STF_NCPA_FLUSH_COPYLIST = TRUE
  1274.    CopyFilesInCopyList
  1275.    exit
  1276.  
  1277.  
  1278.  
  1279.  
  1280.  
  1281. [Source Media Descriptions]
  1282.     1  = "Xircom Setup Disk for NT" 
  1283.  
  1284. [Signature]
  1285.     FileType = MICROSOFT_DRVLIB_FILE
  1286. [GetSignature]
  1287.     read-syms Signature
  1288.     return $(FileType)
  1289.  
  1290. [ProductType]
  1291. STF_PRODUCT  = Winnt
  1292. STF_PLATFORM = I386
  1293.  
  1294.  
  1295. [Files-Inf]
  1296. 1, OEMSETNT.INF, SIZE=43500,    RENAME=$(!UG_Filename)
  1297.  
  1298. [Files-Dll]
  1299. 1, XIRCOM.DLL,  SIZE=9728
  1300.  
  1301. [Files-CM2NDIS3]
  1302. 1, CM2NDIS3.SYS, SIZE=43008
  1303.  
  1304.  
  1305. [LanguagesSupported]
  1306.     ENG
  1307.  
  1308. [AllFileConstantsENG]
  1309. ProCaption   = "Windows NT Setup"
  1310. ProCancel    = "Cancel"
  1311. ProCancelMsg = "Windows NT Networking is not correctly installed.  "+
  1312.            "Are you sure you want to cancel copying files?"
  1313. ProCancelCap = "Network Setup Message"
  1314. ProText1     = "Copying:"
  1315. ProText2     = "To:"
  1316. DialogDllName     = "XIRCOM.DLL"
  1317.  
  1318.  
  1319.  
  1320.  
  1321. ; CEM2 ---------------------------------------------------------------------------------------
  1322. [FileConstantsENG-CM2NDIS3]
  1323. FunctionTitle   = "CreditCard Ethernet+Modem II "$(GenericInfVersion)
  1324. ProductSoftwareTitle        = $(GenericDriverName)
  1325. ProductHardwareCENDIS3Title = $(GenericAdapterName)
  1326. ProductHardwareTitle        = $(GenericAdapterName)
  1327. IRQList           = ^(IRQChoices, 1)
  1328. IRQValues         = ^(IRQChoices, 2)
  1329. IOBaseAddrList    = ^(IOBaseAddrChoices, 1)     
  1330. IOBaseAddrValues  = ^(IOBaseAddrChoices, 2)
  1331. MemoryAddrList    = ^(MemoryAddrChoices,1)
  1332. MemoryAddrValues  = ^(MemoryAddrChoices,2)
  1333. ModemInterruptNumberList =      ^(IRQChoices, 1)
  1334. ModemInterruptNumberValues = ^(IRQChoices, 2)
  1335. ModemIOBaseAddressList   = ^(ModemIOBaseAddressChoices,1)
  1336. ModemIOBaseAddressValues = ^(ModemIOBaseAddressChoices,2)
  1337. SocketNumberList   =  ^(SocketNumberChoices,1)
  1338. SocketNumberValues =  ^(SocketNumberChoices,2)
  1339.  
  1340.  
  1341. [DialogConstantsENG-CM2NDIS3]
  1342. Help        = "&Help"
  1343. Exit        = "Cancel"
  1344. OK          = "OK"
  1345. HelpContext = ""
  1346. Continue    = "Continue"
  1347. Cancel      = "Cancel"
  1348. ;CardInfo    = "Card Info"
  1349.  
  1350. [FileDependentDlgENG-CM2NDIS3]
  1351. DlgType = "RadioCombination"
  1352. DlgTemplate = "CEM2"
  1353. Caption = $(FunctionTitle)
  1354. HelpContext = $(!IDH_DB_OEMNADE2_INS)
  1355. CBOptionsGreyed = {}
  1356. NotifyFields = {NO, NO, NO, NO, NO, NO}
  1357. Combo1Label = "I/&O Port Address:"                  
  1358. Combo2Label = "&Memory Address:"
  1359. Combo3Label = "&Interrupt:"
  1360. Combo4Label = "Modem &Port Address:"
  1361. Combo5Label = "Modem In&terrupt:"
  1362. Combo6Label = "PCMCIA &chip set:"
  1363. ;---------------------------
  1364. Combo1List = $(IOBaseAddrList)
  1365. Combo1Out  = $(IOBaseAddrValue)
  1366. Combo2List = $(MemoryAddrList)
  1367. Combo2Out  = $(MemoryAddrValue)
  1368. Combo3List = $(IRQList)
  1369. Combo3Out  = $(IRQValue)
  1370. Combo4List = $(ModemIOBaseAddressList)
  1371. Combo4Out  = $(ModemIOBaseAddressValue)
  1372. Combo5List = $(IRQList)
  1373. Combo5Out  = $(ModemInterruptNumberValue)
  1374. Combo6List = $(SocketNumberList)
  1375. Combo6Out  = $(SocketNumberValue)
  1376. ;---------------------------
  1377. ComboListItemsIn  = {Combo1List,Combo2List,Combo3List,Combo4List,Combo5List,Combo6List}
  1378. ComboListItemsOut = {Combo1Out,Combo2Out,Combo3Out,Combo4Out,Combo5Out,Combo6Out}
  1379. EditTextIn = {"", ""}
  1380. EditTextLim = {"",""}
  1381. ; END CEM2 ---------------------------------------------------------------------------------------
  1382.  
  1383.  
  1384. [MemoryAddrChoices]
  1385. MA_1  = "0xA0000", 655360
  1386. MA_2  = "0xA1000", 659456
  1387. MA_3  = "0xA2000", 663552
  1388. MA_4  = "0xA3000", 667648
  1389. MA_5  = "0xA4000", 671744
  1390. MA_6  = "0xA5000", 675840
  1391. MA_7  = "0xA6000", 679936
  1392. MA_8  = "0xA7000", 684032
  1393. MA_9  = "0xA8000", 688128
  1394. MA_10 = "0xA9000", 692224
  1395. MA_11 = "0xAA000", 696320
  1396. MA_12 = "0xAB000", 700416
  1397. MA_13 = "0xAC000", 704512
  1398. MA_14 = "0xAD000", 708608
  1399. MA_15 = "0xAE000", 712704
  1400. MA_16 = "0xAF000", 716800
  1401. MA_17 = "0xB0000", 720896
  1402. MA_18 = "0xB1000", 724992
  1403. MA_19 = "0xB2000", 729088
  1404. MA_20 = "0xB3000", 733184
  1405. MA_21 = "0xB4000", 737280
  1406. MA_22 = "0xB5000", 741376
  1407. MA_23 = "0xB6000", 745472
  1408. MA_24 = "0xB7000", 749568
  1409. MA_25 = "0xB8000", 753664
  1410. MA_26 = "0xB9000", 757760
  1411. MA_27 = "0xBA000", 761856
  1412. MA_28 = "0xBB000", 765952
  1413. MA_29 = "0xBC000", 770048
  1414. MA_30 = "0xBD000", 774144
  1415. MA_31 = "0xBE000", 778240
  1416. MA_32 = "0xBF000", 782336
  1417. MA_33 = "0xC0000", 786432
  1418. MA_34 = "0xC1000", 790528
  1419. MA_35 = "0xC2000", 794624
  1420. MA_36 = "0xC3000", 798720
  1421. MA_37 = "0xC4000", 802816
  1422. MA_38 = "0xC5000", 806912
  1423. MA_39 = "0xC6000", 811008
  1424. MA_40 = "0xC7000", 815104
  1425. MA_41 = "0xC8000", 819200
  1426. MA_42 = "0xC9000", 823296
  1427. MA_43 = "0xCA000", 827392
  1428. MA_44 = "0xCB000", 831488
  1429. MA_45 = "0xCC000", 835584
  1430. MA_46 = "0xCD000", 839680
  1431. MA_47 = "0xCE000", 843776
  1432. MA_48 = "0xCF000", 847872
  1433. MA_49 = "0xD0000", 851968
  1434. MA_50 = "0xD1000", 856064
  1435. MA_51 = "0xD2000", 860160
  1436. MA_52 = "0xD3000", 864256
  1437. MA_53 = "0xD4000", 868352
  1438. MA_54 = "0xD5000", 872448
  1439. MA_55 = "0xD6000", 876544
  1440. MA_56 = "0xD7000", 880640
  1441. MA_57 = "0xD8000", 884736
  1442. MA_58 = "0xD9000", 888832
  1443. MA_59 = "0xDA000", 892928
  1444. MA_60 = "0xDB000", 897024
  1445. MA_61 = "0xDC000", 901120
  1446. MA_62 = "0xDD000", 905216
  1447. MA_63 = "0xDE000", 909312
  1448. MA_64 = "0xDF000", 913408
  1449. MA_65 = "0xE0000", 917504
  1450. MA_66 = "0xE1000", 921600
  1451. MA_67 = "0xE2000", 925696
  1452. MA_68 = "0xE3000", 929792
  1453. MA_69 = "0xE4000", 933888
  1454. MA_70 = "0xE5000", 937984
  1455. MA_71 = "0xE6000", 942080
  1456. MA_72 = "0xE7000", 946176
  1457. MA_73 = "0xE8000", 950272
  1458. MA_74 = "0xE9000", 954368
  1459. MA_75 = "0xEA000", 958464
  1460. MA_76 = "0xEB000", 962560
  1461. MA_77 = "0xEC000", 966656
  1462. MA_78 = "0xED000", 970752
  1463. MA_79 = "0xEE000", 974848
  1464. MA_80 = "0xEF000", 978944
  1465. MA_81 = "0xF0000", 983040
  1466. MA_82 = "0xF1000", 987136
  1467. MA_83 = "0xF2000", 991232
  1468. MA_84 = "0xF3000", 995328
  1469. MA_85 = "0xF4000", 999424
  1470. MA_86 = "0xF5000", 1003520
  1471. MA_87 = "0xF6000", 1007616
  1472. MA_88 = "0xF7000", 1011712
  1473. MA_89 = "0xF8000", 1015808
  1474. MA_90 = "0xF9000", 1019904
  1475. MA_91 = "0xFA000", 1024000
  1476. MA_92 = "0xFB000", 1028096
  1477. MA_93 = "0xFC000", 1032192
  1478. MA_94 = "0xFD000", 1036288
  1479. MA_95 = "0xFE000", 1040384
  1480.  
  1481. [TransceiverChoices]
  1482. TR_1 = "Twisted Pair (10bT)", 0
  1483. TR_2 = "Thin Net (10b2 BNC/COAX)", 1
  1484.  
  1485. [IRQChoices]
  1486. ;Interrupts available on the PCIC: { 3,4,5,7,8,10,11,12,14,15 }
  1487. ;Interrupts available on the TCIC: { 3,4,5,6,7,10,14 }
  1488. ;14 = fixed disk
  1489. ;12 = keyboard
  1490. ;6  = floppy disk
  1491. ;union(PCIC, TCIC) - {14} = 3,4,5,7,10
  1492. IRQ_1 = "3",3
  1493. IRQ_2 = "4",4
  1494. IRQ_3 = "5",5
  1495. IRQ_4 = "7",7
  1496. IRQ_5 = "10",10
  1497. IRQ_6 = "11",11
  1498. IRQ_7 = "15",15
  1499.  
  1500. [ModemIOBaseAddressChoices]
  1501. MdmIOBase_1  = "0x3F8",1016
  1502. MdmIOBase_2  = "0x2F8",760
  1503. MdmIOBase_3  = "0x3E8",1000
  1504. MdmIOBase_4  = "0x2E8",744
  1505.      
  1506. [SocketNumberChoices]
  1507. Socket_1  = "Intel PCIC and Compatible", 0
  1508. Socket_2  = "VLSI (Compaq Elite, AST)", 1
  1509.  
  1510.  
  1511. [IOBaseAddrChoices]
  1512. ; 0x3E0 is where PCIC is located
  1513. ; 0x240 is where TCIC is located
  1514. ; therefore user cannot select these for locating the ethernet adapter
  1515. IOBase_1  = "0x200",512
  1516. IOBase_3  = "0x220",544
  1517. ;IOBase_5  = "0x240",576
  1518. IOBase_7  = "0x260",608
  1519. IOBase_9  = "0x280",640
  1520. IOBase_11 = "0x2A0",672
  1521. IOBase_13 = "0x2C0",714
  1522. IOBase_15 = "0x2E0",746
  1523. IOBase_17 = "0x300",768
  1524. IOBase_19 = "0x320",800
  1525. IOBase_21 = "0x340",832
  1526. IOBase_23 = "0x360",864
  1527. IOBase_25 = "0x380",896
  1528. IOBase_27 = "0x3A0",928
  1529. IOBase_29 = "0x3C0",960
  1530.  
  1531.  
  1532.  
  1533.